<template>
	<view>
		<input type="text" />
		<input type="text" />
		<button @click="handleLogin" type="primary">登录</button>
	</view>
</template>

<script>
	import {
		login
	} from '../../api/user';
	import store from '../../store';
	import {
		rsaEncrypt
	} from '../../utils';
	import storage from '../../utils/storage';
	export default {
		data() {
			return {

			};
		},
		methods: {
			async handleLogin() {
				const res = await login({
					password: rsaEncrypt('88888888'),
					userName: 'admin'
				})
				console.log(res, 'xxxxxxxxx')
				if(res.code==200){
					storage.set('user',res.data)
					uni.switchTab({
						url:'/pages/home/home'
					})
				}
			},
		}
	}
</script>

<style lang="scss">

</style>